1. Technical Field
This invention generally relates to database computer systems. In particular, the present invention relates to methods for journaling changes to a database to allow for recovery of the database should corruption of data in the database occur.
2. Background Art
Since the dawn of the computer age, computers have evolved and become more and more powerful. In our present day, computers have become indispensable in many fields of human endeavor including engineering design, machine and process control, and information storage and access. One of the primary uses of computers is for information storage and retrieval.
Database systems have been developed that allow a computer to store a large amount of information in a way that allows a user to search for and retrieve specific information in the database. For example, an insurance company may have a database that includes all of its policy holders and their current account information, including payment history, premium amount, policy number, policy type, exclusions to coverage, etc. A database system allows the insurance company to retrieve the account information for a single policy holder among the thousands and perhaps millions of policy holders in its database. A database typically has many users and processes that can change data in the database. One very important concern in database systems relates to the recovery of data should a problem, such as a power outage or system failure, cause the loss of data. Mechanisms have been developed to log or journal changes to a database so that the database can be reconstructed from the log or journal if data is lost for some reason. These mechanisms are referred to herein as journal mechanisms, realizing that different names may be used to refer to the journaling function.
The most common type of journal in modern database systems is the write-ahead journal. The write-ahead journal actually records a change to data in the database in the journal before recording the change in the database itself. In this manner, if a failure occurs between the journaling of the change and the change itself, the change will be properly made when the database is reconstructed from the journal.
Databases typically include a management mechanism that allows multiple processes to access and change data in the database at the same time. Each process, however, must record their changes in the same journal. Therefore, even though multiple processes are allowed to make changes to a database simultaneously, they must each "wait their turn" when making changes to the journal. (The act of recording change information in the journal is referred to herein as "depositing" information in the journal.) Thus, the journal can become a performance bottleneck when many processes are trying to access the journal at the same time.
While known journaling techniques allow information deposited in a journal to be written to multiple arms of a hard disk drive in parallel fashion, the deposits are typically serialized among processes to maintain the time-order of the deposits. Thus, the order of deposit reflects the order of changes in the database. In this manner the journal can be used to efficiently reconstruct the database when recovery becomes necessary. The problem, though, is that the time-ordering leaves the journal performance bottleneck in place.
The performance bottleneck of serializing entries to the journal can become an even greater problem in computing environments with multiple processors. As the number of processors increases, the number of processes that may access the database increases, causing a corresponding increase in contention for making deposits on the journal. The greater the number of processors, the more critical this performance bottleneck becomes. Without an improved mechanism and method for depositing database change information in a journal, the computer industry will continue to suffer from undue performance degradation caused by serializing deposits to the database journal.